/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.telsoft.util;
import java.util.Calendar;
import java.util.Date;

/**
 *
 * @author rongnk
 */
public class Converter {
  
    public static String convertIntToString(int input)
    {
        return Integer.toString(input);
    }
    
    public static int convertStringToInt(String input)
    {
        if(input != null)
        {
            return Integer.parseInt(input);
        }
        else
        {
            return -1;
        }
    }
    
    public static Calendar convertDateToCalendar(Date date) 
    {   
        Calendar cal=Calendar.getInstance();
        
        try 
        {  
            cal.setTime(date);
        }
        catch (Exception e)
        {
            System.out.println("Exception : " + e);  
        }  
        
        return cal;
    }    
    
}
